package com.cy.pj.sys.dao;

import com.cy.pj.common.pojo.Node;
import com.cy.pj.sys.pojo.SysMenu;
import com.cy.pj.sys.pojo.SysUserMenu;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface SysMenuDao {
    List<Map<String,Object>>findObjects();
    @Select("select count(*) from sys_menus where parentId=#{id}")
    int getChildCount(Integer id);
    @Delete("delete from sys_menus where id=#{id}")
    int deleteObject(Integer id);
    @Select("select id,name,parentId from sys_menus")
    List<Node> findZtreeMenuNodes();
    int insertObject(SysMenu entity);
    int updateObject(SysMenu entity);
    List<String> findPermissions(@Param("menuIds") List<Integer> menuIds);
    List<SysUserMenu> findMenusByIds(@Param("menuIds")List<Integer> menuIds);
}
